package com.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.entity.Car;
import com.entity.chat.ChatMsg;
import com.mapper.CarMapper;

@Service
public class CarService {
	@Autowired
	CarMapper carmapper;
	
	/**插入一条购买记录到购物车*/
	public void insertCar(Car car){
		carmapper.insertCar(car);
    }
	/**查询一个用户的所有购物车记录 */
	public List<Car> lookCar(String user_id){
		List<Car> cars=carmapper.lookCar(user_id);
		return cars;
	}
	/**删除一条具体的购物车记录*/
	public void updateCar(int number) {
		carmapper.updateCar(number);
	}
	/**删除一条具体的购物车记录*/
	public void deleteCar(int car_id) {
		carmapper.deleteCar(car_id);
	}
}
